﻿namespace Chain.Wechat
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Xml;

    public class VideoResponse : IResponse
    {
        
        private string _Description;
        
        private string _MediaId;
        
        private string _Title;

        public VideoResponse(IRequest req, string mediaId, string title, string description) : base(req)
        {
            base.Request = req;
            this.MediaId = mediaId;
            this.Title = title;
            this.Description = description;
            XmlNode xml = base.XmlDoc.GetElementsByTagName("xml")[0];
            XmlElement nodeMsgType = base.XmlDoc.CreateElement("MsgType");
            XmlCDataSection xmlCData = base.XmlDoc.CreateCDataSection("text");
            nodeMsgType.AppendChild(xmlCData);
            xml.AppendChild(nodeMsgType);
            XmlElement nodeVideo = base.XmlDoc.CreateElement("Video");
            XmlElement nodeMediaId = base.XmlDoc.CreateElement("MediaId");
            xmlCData = base.XmlDoc.CreateCDataSection(mediaId);
            nodeMediaId.AppendChild(xmlCData);
            nodeVideo.AppendChild(nodeMediaId);
            XmlElement nodeTitle = base.XmlDoc.CreateElement("Title");
            xmlCData = base.XmlDoc.CreateCDataSection(mediaId);
            nodeTitle.AppendChild(xmlCData);
            nodeVideo.AppendChild(nodeTitle);
            XmlElement nodeDescription = base.XmlDoc.CreateElement("Description");
            xmlCData = base.XmlDoc.CreateCDataSection(mediaId);
            nodeDescription.AppendChild(xmlCData);
            nodeVideo.AppendChild(nodeDescription);
            xml.AppendChild(nodeVideo);
        }

        public string Description
        {
            
            get
            {
                return this._Description;
            }
            
            set
            {
                this._Description = value;
            }
        }

        public string MediaId
        {
            
            get
            {
                return this._MediaId;
            }
            
            set
            {
                this._MediaId = value;
            }
        }

        public string Title
        {
            
            get
            {
                return this._Title;
            }
            
            set
            {
                this._Title = value;
            }
        }
    }
}

